package com.dak.robot.Service.Impl;

import com.dak.robot.Dao.ListenedgroupDao;
import com.dak.robot.Service.ListenedGroupService;
import com.dak.robot.Service.ListenedService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ListenedGroupServiceImpl implements ListenedGroupService {
    @Resource
    private ListenedgroupDao listenedgroupDao;

    @Override
    public int deleteGroup(Long group_id) {
        return listenedgroupDao.deleteByPrimaryKey(group_id);
    }

    @Override
    public int insertGroup(Long group_id) {
        return listenedgroupDao.insert(group_id);
    }

    @Override
    public boolean checkInOrNotForGroup(Long group_id) {
        return listenedgroupDao.selectOne(group_id)>0;
    }

    @Override
    public List<Long> selectAllGroup() {
        return listenedgroupDao.selectAll();
    }
}
